#ifndef IMAGERECONITION_H
#define IMAGERECONITION_H

#include <QObject>
#include <QString>
#include <QMap>
#include <httprequest.h>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QJsonParseError>
#include <QDebug>
#include <QHostInfo>
#include <QFile>
#include <QMessageBox>
class image: public QObject
{
    Q_OBJECT
public:
    explicit image(QObject *parent = nullptr);
    QString getAccessToken();
    QString getJsonValue(QString key,QByteArray replyData);
    QJsonObject getValue(QString key,QByteArray replyData);
    QString submitRequest1(QString accessToken,QByteArray image);
    QString submitRequest2(QString accessToken,QString taskId);
    QString submitRequest3(QString accessToken,QByteArray image);
private:
    QString imageQuery;
    const QString baidu_tokenUrl="https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=%1&client_secret=%2";
    const QString api_key="pTp5asIkY305H90itSyhT76Y";
    const QString secret_key="G1cTCkNfv2CSrBkT6ce5fbu5pEtbMiVr";
    const QString image_Url1="https://aip.baidubce.com/rest/2.0/image-classify/v1/image-understanding/request?access_token=%1";
    const QString image_Url2="https://aip.baidubce.com/rest/2.0/image-classify/v1/image-understanding/get-result?access_token=%1";
    const QString image_Url3="https://aip.baidubce.com/rest/2.0/image-classify/v1/animal?access_token=%1";
signals:

};

#endif // IMAGERECONITION_H
